package org.cmg.study.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author CMG
 * @version 1.0
 * @cLassName ExceptionController
 * @description
 * @date 2021/9/6 13:40
 **/
@Controller
public class ExceptionController {

    @RequestMapping("/exception")
    public String testExceptionHandle(@RequestParam("i") Integer i) {
        System.out.println(10 / i);
        return "success";
    }

    /*@ExceptionHandler({ArithmeticException.class})
    public String testArithmeticException(Exception e) {
        System.out.println("打印错误信息 ===> ArithmeticException； " + e);
        return "error1";
    }*/
}
